package com.fjxd.feign.clients;

import com.fjxd.feign.pojo.FlightNumber;
import com.fjxd.feign.pojo.vo.HotCityVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "flightNumberService")
public interface FlightNumberClient {
    /**
     * 通过起飞城市id和降落城市id查出相对应的航班信息
     *
     * @param cityId1 第一个城市id
     * @param cityId2 第二个城市id
     * @return 返回一个航班号信息
     */
    @GetMapping("/flightNumber/getFlightNumberIdByCity/{city1}&{city2}")
    List<Integer> getFlightNumberIdByCity(@PathVariable String  city1, @PathVariable String city2);


    /**
     * 通过起飞城市id和降落城市id查出相对应的航班信息
     *
     * @param upCityId   起飞城市id
     * @param downCityId 降落城市id
     * @param startIndex 起始页码
     * @param size       数量
     * @return 返回一个航班号id数组
     */
    @GetMapping("/flightNumber/getFlightNumberIdByUpCityId/{upCityId}/{downCityId}")
    List<Integer> getFlightNumberIdByUpCityId(@PathVariable Integer upCityId, @PathVariable Integer downCityId, @RequestParam Integer startIndex, @RequestParam Integer size);


    @GetMapping("/flightNumber/getFlightNumberIdByDownCityId/{upCityId}/{downCityId}")
    List<FlightNumber> getFlightNumberIdByDownCityId(@PathVariable Integer upCityId, @PathVariable Integer downCityId);

    @GetMapping("/flightNumber/getFlightNumberIdByDownCityId/{downCityId}")
    List<FlightNumber> getFlightNumberIdByDownCityId(@PathVariable Integer downCityId);

    @GetMapping("/flightNumber/getFlightNumberByUpCityId/{upCityId}/{downCityId}")
    List<FlightNumber> getFlightNumberByUpCityIdAndDownCityId(@PathVariable Integer upCityId, @PathVariable Integer downCityId, @RequestParam Integer startIndex, @RequestParam Integer size);

    /**
     * 获取所有的航班号信息
     *
     * @return 返回所有的航班号信息
     */
    @GetMapping("/flightNumber")
    List<FlightNumber> getAll();

    /**
     * 通过id获取航班信息
     * @param id int数值
     * @return 返回一个航班对象
     */
    @GetMapping("/flightNumber/getById/{id}")
    FlightNumber getFlightNumberById(@PathVariable Integer id);

    @GetMapping("/flightNumber/getFlightNumberByPlaneId/{id}")
    List<FlightNumber> getFlightNumberByPlaneId(@PathVariable Integer id);


    @GetMapping("/flightNumber/getHotCity/{id}")
    List<HotCityVo> getHotCity(@PathVariable Integer id);

    @PostMapping("/flightNumber/getManyMsg")
    List<FlightNumber> getManyMsg(@RequestBody List<Integer> ids);
}
